<template>
  <div>
    <router-link
      :to="{
        name: 'game',
        params: {
          a: 1,
        },
      }"
      >点击跳转Game</router-link
    >
    <router-link :to="{ name: 'music', params: { name: '罗飞', id: 1 } }"
      >点击跳转Music1</router-link
    >
    <router-link :to="{ name: 'music', params: { name: '王远', id: 2 } }"
      >点击跳转Music2</router-link
    >
    <!--keep-alive 路由之间的切换就是挂载和卸载的过程  缓存组件不会在重复挂载和卸载 
      -->
    <router-link
      :to="{
        name: 'game',
        query: {
          name: '罗飞',
          id: 1,
        },
      }"
      >点击玩游戏</router-link
    >
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Home",
};
</script>

<style>
</style>